<script setup lang="ts">
import { useRoute, useRouter } from 'vue-router';

const router=useRoute()
const routers=useRouter()
</script>

<template>
  <div class="search" >
    <p>文章详情的id: {{ $route.params.id }}</p>
    <button @click="routers.push('/')">返回首页</button>
  </div>
</template>

<style scoped>
.search{
  width: 100%;
  height: 300px;
  background-color: pink;
}
</style>